]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Always close the tray when clicking outside of it
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 16 Aug 2012 17:49:35 +0000 (13:49 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 20 Aug 2012 01:15:50 +0000 (21:15 -0400)
Even when a summary box pointer item is up.

js/ui/grabHelper.js
js/ui/messageTray.js

index 8b04dbdad3a1e5253578160a3a21f72f73a75ddf..4a72351bbd53824a776fd2222b356c42a2aaf945 100644 (file)
@@ -84,7 +84,14 @@ const GrabHelper = new Lang.Class({
     },
 
     get currentGrab() {
-        return this._grabStack[this._grabStack.length - 1] || {};
+        if (!this._grabStack.length)
+            return {};
+
+        let idx = this._grabStack.length - 1;
+        while (idx >= 0 && this._grabStack[idx].untracked)
+            idx--;
+
+        return this._grabStack[idx];
     },
 
     _findStackIndex: function(actor) {
@@ -132,10 +139,13 @@ const GrabHelper = new Lang.Class({
     // revert it back, and re-focus the previously-focused window (if
     // another window hasn't been explicitly focused before then).
     //
-    //
+    // If @params contains { untracked: true }, then it will be skipped
+    // when the grab helper ungrabs for you, or when calculating
+    // currentGrab.
     grab: function(params) {
         params = Params.parse(params, { actor: null,
                                         modal: false,
+                                        untracked: false,
                                         grabFocus: false,
                                         onUngrab: null });
 
index a52702a932149a3467bf2a5c01e3f11f0ae4f965..8b5286b003f9bb9dccad5a2f2c94df36ad8d3a26 100644 (file)
@@ -2213,6 +2213,7 @@ const MessageTray = new Lang.Class({
         }
 
         this._grabHelper.grab({ actor: this._summaryBoxPointer.bin.child,
+                                untracked: true,
                                 grabFocus: true,
                                 onUngrab: Lang.bind(this, this._onSummaryBoxPointerUngrabbed) });
         this._lock();